<!-- StudyCreatTeamNew_Frame.html -->
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
		<title>创建小组</title>
		<link rel="stylesheet" type="text/css" href="../../css/api.css" />
		<!-- <link rel="stylesheet" href="../../css/weui.min.css"> -->
		<!-- <link rel="stylesheet" href="../../css/jquery-weui.min.css"> -->
		<link rel="stylesheet" href="../../css/mui.min.css"/>
		<link rel="stylesheet" href="../../css/CFNetPP_Base.css">
		<style type="text/css">
			.base_right_item{
				text-align: center;
				font-size: 14px;
			}
			.plan-table-view{
				background-color: #f3f5f7;
			}
			.plan-cell{
				background-color: white;
				margin-bottom: 8px;
			}
			.plan-cell .cell-p{
				margin: 0;
				font-size: 14px;
				line-height: 30px;
				color: #333;
			}
			.plan-cell .cell-left-div{
				width: 100px;
				height: 30px;
				float: left;
			}
			.plan-cell .cell-right-div{
				margin-left: 100px;
				height: 30px;
			}
			input[type=text]{
				border: none;
				margin: 0;
				padding: 0;
				height: 30px;
				font-size: 14px;
				color: #333;
			}
			.time-input{
				font-size: 14px;
				line-height: 30px;
				height: 30px;
				color: #333;
			}
			.bottom-div{
				position: fixed;
				left: 0;
				bottom: 0;
				height: 50px;
				width: 100%;
				text-align: center;
			}
			.bottom-div-p{
				line-height: 50px;
				color: white;
				background-color: #18b4ed;
				margin: 0;
			}
			.add-btn-cell{
				text-align: center;
			}
			.add-btn-content{
				position: relative;
				font-size: 14px;
				color: #18b4ed;
				padding-left: 24px;
			}
			.add-btn-img{
				width: 20px;
				position: absolute;
				top: 0;
				left: 0;
			}
			.team-name-title-cell{
				background-color: white;
				font-size: 14px;
			}
			.team-name-title{
				color: #333;
			}
			.added-table-view{
				margin-bottom: 10px;
			}
			.added-team-down-img{
				position: absolute;
				top: 10px;
				left: 10px;
				width: 20px;
			}
			.added-table-view-cell{
				background-color: white;
			}
			.added-team-left-span{
				position: absolute;
				top: 0;
				left: 0;
				width: 40px;
				height: 40px;
			}
			.user-title{
				font-size: 14px;
			}
			.user-name{
				font-size: 14px;
				padding-left: 20px;
			}
			.zhan-wei-div{
				height: 50px;
			}
			.added-team-right-span{
				padding-left: 20px;
			}
			.hide-class{
				display: none;
			}
			.have-right-slider-cell{
				padding: 0;
			}
			.slider-left-content{
				padding: 10px;
			}
			.bottom-tool{
				display: none;
			}
			.body-content{
				max-height: 100vh;
				overflow: auto;
			}
		</style>
	</head>
	<body>
		<div class="body-content">
			<div id="creat_div">
				<ul class="mui-table-view plan-table-view">
					<li class="mui-table-view-cell plan-cell">
						<input id="team_name" class="cell-input" type="text" placeholder="请输入小组名称">
					</li>
					<li class="mui-table-view-cell plan-cell" onclick="onAddTeamUserClick()">
						<a class="mui-navigate-right">
							<div class="cell-left-div">
								<p class="cell-p">
									添加小组成员
								</p>
							</div>
						</a>
					</li>
				</ul>
			</div>
			<div id="current_team">
				<!-- <ul class="mui-table-view plan-table-view added-table-view">
					<li class="mui-table-view-cell team-name-title-cell">
						<div class="mui-slider-right mui-disabled">
							<a class="mui-btn mui-btn-yellow">
								编辑
							</a>
							<a class="mui-btn mui-btn-red">
								删除
							</a>
						</div>
						<div class="mui-slider-handle">
							<div class="mui-table-cell team-name-title">
								小组1
							</div>
						</div>
					</li>
					<li class="mui-table-view-cell added-table-view-cell">
						<a class="mui-navigate-right">
							<div class="cell-left-div">
								<p class="cell-p">
									<span class="added-team-left-span">
										<img class="added-team-down-img" src="../../image/icon_team_down.png">
									</span>
									<span class="added-team-right-span">
										小组成员
									</span>
								</p>
							</div>
						</a>
					</li>
					<div class="team-user-list">
						<li class="mui-table-view-cell added-table-view-cell">
							<div class="mui-slider-right mui-disabled">
								<a class="mui-btn mui-btn-red">
									删除
								</a>
							</div>
							<div class="mui-slider-handle">
								<div class="mui-table-cell user-name">
									孙晓丽
								</div>
							</div>
						</li>
						<li class="mui-table-view-cell added-table-view-cell">
							<div class="mui-slider-right mui-disabled">
								<a class="mui-btn mui-btn-red">
									删除
								</a>
							</div>
							<div class="mui-slider-handle">
								<div class="mui-table-cell user-name">
									孙晓丽
								</div>
							</div>
						</li>
					</div>
				</ul> -->
			</div>
			<div id="add_div" class="hide-class" onclick="addTeamClick();">
				<ul class="mui-table-view plan-table-view">
					<li class="mui-table-view-cell plan-cell add-btn-cell">
						<span class="add-btn-content">
							<img class="add-btn-img" src="../../image/icon_team_add.png">
							添加小组
						</span>
					</li>
				</ul>
			</div>
		</div>
		<div class="zhan-wei-div bottom-tool"></div>
		<div class="bottom-div bottom-tool" onclick="onFinishClick()">
			<p class="bottom-div-p">
				完成
			</p>
		</div>
	</body>
	<script type="text/javascript" src="../../script/jquery.min.js"></script>
	<script type="text/javascript" src="../../script/mui.min.js"></script>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script type="text/javascript">
		var currentTeamArr = new Array();
		var delUserId = '';//要删除的uid
		var delUserIndex = 0;//记录当前删除的数组下标
		var currentEditTeamId = '';//要编辑的小组id 
		var currentEditTeamName = '';//当前要编辑的小组名
		var newCreatTeamId = '';//新创建的小组id
		var newCreatTeamName = '';//新创建的小组名称
		apiready = function() {
			setupNotifi();
			setupPageType();
			loadTeamData();
			setupTeamNameInput();
			sendBuriedNotifi('0', '添加学习计划小组人员页', '218')
		}
		function sendBuriedNotifi(busionessid, pagetype, pagetypeid) {
			var userinfo = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjxid'),
				uname : $api.getStorage('cfnetppusername'),
			}
			var data = {
				busionessid : busionessid,
				pagetype : pagetype,
				pagetypeid : pagetypeid,
				sourceurl : api.pageParam.sourceurl,
				sourcetitle : api.pageParam.sourcetitle,
				accesspageurl : window.location.pathname,
				accesspagetitle : document.title,
				userinfo : userinfo
			}
			SendBehaviorTrajectoriesNotifi_Study(data);
		}
		//设置输入框长度限制
		function setupTeamNameInput(){
			$('#team_name').bind('input propertychange', function() {  
	            var currentName = $('#team_name').val();
	            if (currentName.length > 20) {
	                currentName = currentName.slice(0,20);
	                $('#team_name').val(currentName);
	                api.toast({
	                    msg: '小组名称最长20字'
	                });
	            }
	        });
		}
		//设置页面类型：编辑/创建
		function setupPageType(){
			if (api.pageParam.planType == 'edit') {//编辑模式
				setupEditUI();
			}else{
				setupCreatUI();
			}
		}
		//设置编辑模式下的页面UI
		function setupEditUI(){
			$('.bottom-tool').hide();
			api.showProgress({
			    style: 'default',
			    animationType: 'fade',
			    title: '',
			    text: '加载小组中...',
			    modal: false
			});
		}
		//设置创建模式下的页面UI
		function setupCreatUI(){
			$('.bottom-tool').show();
		}
		//点击完成
		function onFinishClick(){
			if (currentTeamArr.length == 0) {
				var teamName = $("#team_name").val();
				if (teamName == null || teamName == '') {
					finishDialog();
				}else{//有输入小组名称则创建小组后退出
					creatTeam(teamName, function(status){
						if (status == true) {//创建成功
							onFinish();
						}else{//创建失败
							finishDialog();
						}
					});
				}
			}else{
				onFinish();
			}
		}
		//确认弹出窗
		function finishDialog(){
			var btnArray = ['取消', '确认'];
			mui.confirm('您还没有创建小组是否确认完成？', '提醒', btnArray, function(e) {
				if (e.index == 1) {//确认
					onFinish();
				}
			});
		}
		//完成操作
		function onFinish(){
			api.sendEvent({
			    name: 'refreshTeacherCourseListNotifi'
			});
			api.closeToWin({
			    name: 'Teacher_NewCourseListWin'
			});
		}
		//清空新创建数据
		function clearNewCreatData(){
			$("#team_name").val('');
			newCreatTeamId = '';
			newCreatTeamName = '';
		}
		//创建时添加小组成员（非编辑模式）
		function onAddTeamUserClick(){
			if (newCreatTeamId == '') {//没有新的小组id时创建小组
				var newTeamName = $("#team_name").val();
				if (newTeamName != null && newTeamName != '') {
					creatTeam(newTeamName, function(status){
						if (status == true) {
							loadTeamData();
							pushToSelectUserPage(newCreatTeamId);
						}
					});
				}else{
					api.toast({
					    msg: '请输入小组名称'
					});
				}
			}
		}
		//创建小组
		function creatTeam(teamName, callback){
			var instime = (new Date()).valueOf();
			var params = {
				pid : api.pageParam.pid,
				jid : $api.getStorage('cfnetppjxid'),
				instime : instime,
				names : teamName
			};
			cfnetppPOST(url_addPlanTeam, params, false, function(data, status){
			  SendBusinessOperationsLogNotifi('老师添加学习计划下小组', '218', params, params, '', data, '老师添加学习计划下小组接口', '218-01');
				if (status == 'success') {
					if (data.code == 200) {
						newCreatTeamId = data.data.id;
						newCreatTeamName = teamName;
						api.toast({
						    msg: '创建小组成功'
						});
						callback(true);
					}else{
						api.toast({
						    msg: '创建小组失败请重试'
						});
						callback(false);
					}
				}else{
					api.toast({
					    msg: '创建小组失败请重试'
					});
					callback(false);
				}
			});
		}
		//设置通知
		function setupNotifi(){
			api.addEventListener({
			    name: 'addPlanTeamStuNotifi'
			}, function(ret, err) {
			    var value = ret.value;
			    var tid = value.tid;
			    var selectedStuArr = value.data;
			    if (selectedStuArr == null || selectedStuArr.constructor != Array || selectedStuArr.length == 0) {
			    	return;
			    }
			    //取出小组数据所在数组的下标
			    var index = parseInt($('#select_user'+tid).attr('index'));
			    var teamData = currentTeamArr[index];
			    var teamUserArr = teamData.teamuser;
			    teamUserArr = teamUserArr.concat(selectedStuArr);
			    teamData.teamuser = teamUserArr;
			    $('#team_user_list'+tid).html(userHtmlStringWithArr(teamUserArr));
			    $('#select_user'+tid).html(haveUserHtmlWithTid(tid));
			    addCellClick();
			});
		}
		function loadTeamData(){
			var params = {
				pid : api.pageParam.pid,
				jid : $api.getStorage('cfnetppjxid')
			};
			cfnetppPOST(url_planTeamList, params, true, function(data, status){
				api.hideProgress();
				if (status == 'success') {
					if (data.code == 200) {
						var teamList = data.data;
						if (teamList != null && teamList.constructor == Array && teamList.length > 0) {
							currentTeamArr = teamList;
							var teamListHtmlString = new String();
							for (var i = 0; i < teamList.length; i++) {
								var teamData = teamList[i];
								teamListHtmlString += htmlStringWithData(i, teamData);
							}
							$('#current_team').html(teamListHtmlString);
							$('#creat_div').hide();
							$('#current_team').show();
							$('#add_div').show();
							clearNewCreatData();
							addCellClick();
						}else{
							$('#creat_div').show();
							$('#current_team').hide();
							$('#add_div').hide();
						}
					}else{
						$('#creat_div').show();
						$('#current_team').hide();
						$('#add_div').hide();
					}
				}else{
					$('#creat_div').show();
					$('#current_team').hide();
					$('#add_div').hide();
				}
			});
		}
		//跳转至选人页面
		function pushToSelectUserPage(tid){
			var param = {
				type : 1,//学生
		        pid : api.pageParam.pid,
		        tid : tid,
		        sourceurl : window.location.pathname,
			    sourcetitle : document.title
			};
			sendBuriedNotifi('1', '添加学习计划小组人员页', '218')
			api.openWin({useWKWebView:true,
			    name: 'StudyCreatPlan_SelectStu_Win',
			    url: 'StudyCreatPlan_SelectStu_Win.html',
			    pageParam: param
			});
		}
		function addCellClick(){
			//绑定选人跳转选人页面事件
			$('.select-user-cell').unbind('click');
			$('.select-user-cell').click(function(){
				var index = parseInt($(this).attr('index'));
				var teamData = currentTeamArr[index];
				pushToSelectUserPage(teamData.id);
			});
			//绑定展开隐藏人员列表按钮事件
			$('.added-team-left-span').unbind('click');
			$('.added-team-left-span').click(function(event){
				var tid = $(this).attr('tid');
				if($('#team_user_list'+tid).hasClass('hide-class')){
					$('#team_user_list'+tid).removeClass('hide-class');
					$('#show_list_btn_img'+tid).attr('src', '../../image/icon_team_up.png');
				}else{
					$('#team_user_list'+tid).addClass('hide-class');
					$('#show_list_btn_img'+tid).attr('src', '../../image/icon_team_down.png');
				}
				//阻止冒泡
				event.stopPropagation();
			});
			//绑定删除人员事件
			$('.delete-user-btn').unbind('click');
			$('.delete-user-btn').click(function(){
				hideSlider();
				var teamid = $(this).attr('teamid');
				var teamIndex = parseInt($('#teamid'+teamid).attr('index'));
				var teamData = currentTeamArr[teamIndex];
				var userArr = teamData.teamuser;
				var userIndex = parseInt($(this).attr('index'));
				var userData = userArr[userIndex];
				delUserId = userData.blocuid;
				delUserIndex = userIndex;
				var btnArray = ['取消', '确认'];
				mui.confirm('是否确认删除'+userData.rename+'？', '提醒', btnArray, function(e) {
					if (e.index == 1) {//删除
						deleteUser(userData, function(status, delData){
							if (status == true) {
								// $('#user'+delData.blocuid).remove();
								userArr.splice(delUserIndex, 1);
								//刷新数据
							    $('#team_user_list'+teamid).html(userHtmlStringWithArr(userArr));
							    if (userArr.length > 0) {//显示有学生的标题（有向下箭头）
							    	$('#select_user'+teamid).html(haveUserHtmlWithTid(teamid));
							    }else{//显示无学生时小组的标题（没有向下箭头）
							    	$('#select_user'+teamid).html(notHaveUserHtml(teamid));
							    }
							    addCellClick();
							}
						});
					}
				});
				//阻止冒泡
				event.stopPropagation();
			});
			//绑定编辑按钮事件
			$('.edit-team-btn').unbind('click');
			$('.edit-team-btn').click(function(event){
				hideSlider();
				var index = parseInt($(this).attr('index'));
				var teamData = currentTeamArr[index];
				currentEditTeamId = teamData.id;
				currentEditTeamName = teamData.names;
				var btnArray = ['取消', '确定'];
				mui.prompt('请输入你要修改的小组名：', currentEditTeamName, '', btnArray, function(e) {
					if (e.index == 1) {
						var teamName = e.value;
						if (teamName == currentEditTeamName || teamName == '') {
							return;
						}
						editTeamNameWithData(teamName, function(status, resultName){
							if (status == true) {
								$('#team_name'+currentEditTeamId).text(resultName);
							}
						});
					}
				});
				//阻止冒泡
				event.stopPropagation();
			});
			//绑定input事件
			// $("#team_name").focus(function(){
			// 	//获取焦点
			// });
			$(".team-cell-input").unbind('blur');
			$(".team-cell-input").blur(function(){
				//失去焦点
				var tid = $(this).attr('teamid');
				var teamName = $(this).val();
				var oldTeamName = $(this).attr('old_team_name');
				if (teamName == '') {//如果删除了旧的名字时失去焦点，则恢复旧的名字
					$(this).val(oldTeamName);
				}else if(teamName != oldTeamName){//如果当前名字不等于旧的名字，请求接口
					currentEditTeamId = tid;
					editTeamNameWithData(teamName, function(status, resultName){
						if (status == true) {
							$('#team_name'+currentEditTeamId).attr('old_team_name', resultName);
						}
					});
				}
			});
			//绑定删除小组事件
			$('.delete-team-btn').unbind('click');
			$('.delete-team-btn').click(function(event){
				hideSlider();
				var teamid = $(this).attr('teamid');
				var btnArray = ['取消', '确定'];
				mui.confirm('是否确认删除该小组?', '提示', btnArray, function(e) {
					if (e.index == 1) {
						delTeam(teamid, function(status, delTid){
							if (status == true) {
								$('#teamid'+delTid).remove();
							}
						});
					}
				});
				//阻止冒泡
				event.stopPropagation();
			});
			//绑定小组名称长度事件
			$('.team-cell-input').unbind('input propertychange');
			$('.team-cell-input').bind('input propertychange', function() {  
	            var currentName = $(this).val();
	            if (currentName.length > 20) {
	                currentName = currentName.slice(0,20);
	                $(this).val(currentName);
	                api.toast({
	                    msg: '小组名称最长20字'
	                });
	            }
	        });
		}
		//删除小组
		function delTeam(teamid, callback){
			var params = {
				pid : api.pageParam.pid,
				tid : teamid,
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjxid')
			};
			cfnetppPOST(url_delPlanTeam, params, false, function(data, status){
			     SendBusinessOperationsLogNotifi('老师删除学习计划下小组', '218', params, params, '', data, '老师删除学习计划下小组接口', '218-02');
				if (status == 'success') {
					if(data.code == 200){
						api.toast({
						    msg: '删除小组成功'
						});
						if (callback) {
							callback(true, teamid);
						}
					}else if(data.code == 102){
						api.toast({
						    msg: '小组中已添加人员，无法删除'
						});
						if (callback) {
							callback(false);
						}
					}else{
						api.toast({
						    msg: '删除小组失败'
						});
						if (callback) {
							callback(false);
						}
					}
				}else{
					api.toast({
					    msg: '删除小组失败'
					});
					if (callback) {
						callback(false);
					}
				}
			});
		}
		//收缩侧滑
		function hideSlider(){
			$('.right-slider-btn').attr('style', 'transform: translate(0px, 0px);');
			$('.mui-slider-handle').attr('style', 'transform: translate(0px, 0px);');
		}
		//编辑小组名
		function editTeamNameWithData(name, callback){
			api.showProgress({
			    style: 'default',
			    animationType: 'fade',
			    title: '',
			    text: '修改小组名称中...',
			    modal: true
			});
			var params = {
				pid : api.pageParam.pid,
				jid : $api.getStorage('cfnetppjxid'),
				uid : $api.getStorage('cfnetppuid'),
				id : currentEditTeamId,
				names : name
			};
			cfnetppPOST(url_editPlanTeamName, params, false, function(data, status){
			    SendBusinessOperationsLogNotifi('老师编辑学习计划下小组名称', '218', params, params, '', data, '老师编辑学习计划下小组名称接口', '218-03');
				api.hideProgress();
				if (status == 'success') {
					if (data.code == 200) {
						api.toast({
						    msg: '修改小组名称成功'
						});
						callback(true, name);
					}else{
						api.toast({
						    msg: '修改小组名称失败'
						});
						callback(false);
					}
				}else{
					api.toast({
					    msg: '修改小组名称失败'
					});
					callback(false);
				}
			});
		}
		//删除人员
		function deleteUser(userData, callback){
			param = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjxid'),
				pid : api.pageParam.pid,
				tid : userData.teamid,
				students : [{
					blocuid : userData.blocuid,
					uid : userData.uid
				}]
			};
			api.showProgress({
			    style: 'default',
			    animationType: 'fade',
			    title: '',
			    text: '删除中...',
			    modal: true
			});
			cfnetppPOST(url_planTeamDelStu, param, false, function(data, status){
			    SendBusinessOperationsLogNotifi('老师删除学习计划下小组人员', '218', param, param, '', data, '老师删除学习计划下小组人员接口', '218-05');
				api.hideProgress();
				if (status == 'success') {
					if (data.code == 200) {
						api.toast({
						    msg: '删除成功'
						});
						api.sendEvent({
						    name: 'studyPlanDeleteUserNotifi',
						    extra: {
						        userData: userData
						    }
						});
						callback(true, userData);
					}else{
						api.toast({
						    msg: '删除失败，请重试'
						});
						callback(false);
					}
				}else{
					api.toast({
					    msg: '删除失败，请重试'
					});
					callback(false);
				}
			});
		}
		//有人员的小组标签
		function haveUserHtmlWithTid(tid){
			return '<a class="mui-navigate-right">'+
						'<div class="cell-left-div">'+
							'<p class="cell-p">'+
								'<span tid="'+tid+'" class="added-team-left-span">'+
									'<img id="show_list_btn_img'+tid+'" class="added-team-down-img" src="../../image/icon_team_down.png">'+
								'</span>'+
								'<span class="added-team-right-span">小组成员</span>'+
							'</p>'+
						'</div>'+
					'</a>';
		}
		//没有人员的小组标签
		function notHaveUserHtml(){
			return '<a class="mui-navigate-right">'+
						'<div class="cell-left-div">'+
							'<p class="cell-p">添加小组成员</p>'+
						'</div>'+
					'</a>';
		}
		function htmlStringWithData(index, data){
			var userArr = data.teamuser; 
			var userListHtml = '';
			//有人员
			if (userArr != null && userArr.constructor == Array && userArr.length > 0) {
				var userHtmlString = userHtmlStringWithArr(userArr);
				userListHtml = '<li id="select_user'+data.id+'" index="'+index+'" class="mui-table-view-cell added-table-view-cell select-user-cell">'+
					haveUserHtmlWithTid(data.id)+
				'</li>'+
				'<div id="team_user_list'+data.id+'" class="team-user-list hide-class">'+
					userHtmlString+
				'</div>';
			}else{//无人员
				userListHtml = '<li id="select_user'+data.id+'" index="'+index+'" class="mui-table-view-cell added-table-view-cell select-user-cell">'+
					notHaveUserHtml()+
				'</li>'+
				'<div id="team_user_list'+data.id+'" class="team-user-list"></div>';
			}
			return '<ul id="teamid'+data.id+'" index="'+index+'" class="mui-table-view plan-table-view added-table-view">'+
				'<li class="mui-table-view-cell team-name-title-cell have-right-slider-cell">'+
					'<div class="mui-slider-right mui-disabled">'+
						// '<a index="'+index+'" class="edit-team-btn mui-btn mui-btn-yellow">编辑</a>'+
						'<a index="'+index+'" teamid="'+data.id+'" class="delete-team-btn mui-btn mui-btn-red">删除</a>'+
					'</div>'+
					'<div class="mui-slider-handle slider-left-content">'+
						// '<div id="team_name'+data.id+'" class="mui-table-cell team-name-title">'+
						// 	data.names+
						// '</div>'+
						'<input id="team_name'+data.id+'" teamid="'+data.id+'" old_team_name="'+data.names+'" class="team-cell-input team-name-title" type="text" placeholder="请输入小组名称" value="'+data.names+'">'+
					'</div>'+
				'</li>'+
				userListHtml+
			'</ul>';
		}
		//根据人员对象返回人员列表html串
		function userHtmlStringWithData(data, index){
			return '<li id="user'+data.blocuid+'" class="mui-table-view-cell added-table-view-cell have-right-slider-cell">'+
					'<div class="mui-slider-right mui-disabled">'+
						'<a teamid="'+data.teamid+'" index="'+index+'" class="delete-user-btn mui-btn mui-btn-red">删除</a>'+
					'</div>'+
					'<div class="mui-slider-handle slider-left-content">'+
						'<div class="mui-table-cell user-name">'+
							data.rename+
						'</div>'+
					'</div>'+
				'</li>';
		}
		//根据数组返回人员列表html串
		function userHtmlStringWithArr(userArr){
			var userHtmlString = '';
			for (var i = 0; i < userArr.length; i++) {
				var userData = userArr[i];
				userHtmlString += userHtmlStringWithData(userData, i);
			}
			return userHtmlString;
		}
		//添加小组
		function addTeamClick(){
			$('#creat_div').show();
			$('#add_div').hide();
		}
	</script>
</html>